﻿@model SystemDefaultsViewModel
@{
    ViewBag.Title = "Defaults";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript">

function saveSystemDefault(controlId){

    var val = $("#" + controlId).val();
    var code = $("#" + controlId).data('param-code');

    $.ajax({
        url: "@Url.Action("SaveSystemDefault", "Defaults")",
        type: 'POST',
        data: { paramCode: code, value: val },
        //data: { BussinesHoursFrom: val },
        traditional: true,
        success: function (result) {
        
            if(result){
                
                $("#" + controlId + "_Status").css("visibility","visible");
            }
            else{

                alert("Error occured during operation.");
            }
        }
     });
 }
</script>
<!--starts cms dafults-->
<div class="search_result_bd">
    <!--<h4>Search Results</h4>-->
    <div class="zatify_table_content cms_dafults_content">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <th width="26%">
                    Parameter
                </th>
                <th width="24%">
                    Value
                </th>
                <th width="22%">
                    Action
                </th>
                <th width="28%">
                    Status
                </th>
            </tr>
            <tr>
                <td>
                    Business Hour - From
                </td>
                <td>
                    @Html.DropDownListFor(m => m.BusinessHourFrom, ((IEnumerable<SelectListItem>)ViewData["BusinessHoursFrom"]), new { @class = "cms_user_select_box", data_param_code = "BUSINESS_HOURS_FROM" })
                </td>
                <td>
                    <a href="#" onclick="saveSystemDefault('BusinessHourFrom')">
                        <img src="@Url.Content("~/Areas/Admin/Content/zatify/images/save_icon.png")" alt="" title="Edit" border="0" /></a>
                </td>
                <td>
                    <span id="BusinessHourFrom_Status" style="visibility: hidden; color: Green; font-weight: bold;">Saved</span>
                </td>
            </tr>
            <tr>
                <td>
                    Business Hour - To
                </td>
                <td>
                    @Html.DropDownListFor(m => m.BusinessHourTo, ((IEnumerable<SelectListItem>)ViewData["BusinessHoursTo"]), new { @class = "cms_user_select_box", data_param_code = "BUSINESS_HOURS_TO" })
                </td>
                <td>
                    <a href="#" onclick="saveSystemDefault('BusinessHourTo')">
                        <img src="@Url.Content("~/Areas/Admin/Content/zatify/images/save_icon.png")" alt="" title="Edit" border="0" /></a>
                </td>
                <td>
                    <span id="BusinessHourTo_Status" style="visibility: hidden; color: Green; font-weight: bold;">Saved</span>
                </td>
            </tr>
        </table>
    </div>
</div>
<!--end cms dafults-->
